<template>
	<view>
		<!-- 头部 -->
		<view class="top-data">
			<image class="bg" src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/balloon.png" mode=""></image>
			<!-- 	<image class="baby" src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/baby.png" mode=""></image> -->
			<view class="" style="display: flex;align-items: center;position: absolute;left:5%;bottom:30%" @click="goLogin">
				<image class="baby" src="../../static/images/default_avatar.jpg" mode="" style="width:68px;height:68px"></image>
				<view v-if='!zwxphone' class="" style="font-size:18px;font-weight: bold;color:#000;margin-left:8px;">
					立即登录
				</view>
			</view>

			<view class="fill">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/babyList.jpg" mode=""></image>
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/babyList.jpg" mode=""></image>
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/babyList.jpg" mode=""></image>
				<u-icon @click="jump" name="plus-circle-fill" size="60" color="rgb(255,209,21)"></u-icon>
			</view>
		</view>
		<!-- 信息内容 -->
		<view class="section">
			<view class="set" @click="equipmentList">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/sb.png" mode=""></image>
				<text>设备列表</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view>
			<view class="set" @click="BasicsSet">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/jc.png" mode=""></image>
				<text>基础设置</text>
				<u-icon  style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666"></u-icon>
			</view>
				<view class="set" @click="switchSet">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/kg.png" mode=""></image>
				<text>开关机设置</text>
				<u-icon  style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666"></u-icon>
			</view>
			<view class="set" @click="administrators">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/wd.png" mode=""></image>
				<text>管理员</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view>
			<view class="set" style="height: 80rpx;" @click="use">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/zn.png" mode=""></image>
				<text>使用指南</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view>
		<!-- 	<view class="set" style="height: 80rpx;margin-top:20rpx" @click="message">
				<image src="../../static/images/humidity.png" mode="" style="width:46rpx;height:46rpx;border-radius: 50%;left:5%;margin-top:6rpx"></image>
				<text>湿度设置</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view> -->
			<!-- <view class="set" style="height: 80rpx;margin-top:30rpx" @click="message">
				<image src="../../static/images/message.png" mode="" style="width:50rpx;height:50rpx;border-radius: 50%;"></image>
				<text>意见反馈</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view> -->
		<!-- 	<view class="set" style="height: 80rpx;margin-top:30rpx" @click="service">
				<image src="../../static/images/heath.png" mode=""
					style="width:50rpx;height:50rpx;border-radius: 50%;left:4%;margin-top:6rpx"></image>
				<text>穿衣咨询</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view> -->
		</view>
		<view style="background-color: rgb(247,247,247);height: 20rpx;"></view>
		<!-- 联系我们 -->
		<view class="section">
			<view class="set" @click="contact">
				<image src="https://srmzln.oss-cn-hangzhou.aliyuncs.com/znl/images/lx.png" mode=""></image>
				<text>联系我们</text>
				<u-icon style=" position: absolute;right: 0%;top: 10%;" name="arrow-right" size="30" color="#666">
				</u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				zwxphone:''
			}
		},
		mounted(){
				this.zwxphone = uni.getStorageSync('zwxphone');
				
		},
		methods: {
			goLogin(){
				if(!this.zwxphone){
				uni.navigateTo({
					url:'../login/login'
				})
				}
			},
			onTabItemTap(e) {
				let isReq = uni.getStorageSync('reqSubMsg')
				console.log(isReq,889)
				// if (!isReq) {
					wx.requestSubscribeMessage({
						tmplIds: ['up91dKoloxDYPdQ9esJtQaGhBK4eP7Rp0T0lvvq_0Jo',
							'6Pizrg4gB1a91FDG_wYCm2d22VUyln5IemaUhlpn7l4',
							'O-Rxuoj8wQGzHvno9VyUYwkb6ekHqZogM52wgJ7nikU'
						],
						success(res) {
							console.log(res, 998)
							uni.setStorageSync('reqSubMsg', true);
						},
						fail(err) {
							console.log(err, 886)
						}
					})
				// }
			},
			// 设备列表
			equipmentList() {
				console.info("设备列表");
				uni.navigateTo({
					url: '/pages/my/equipment/equipmentList'
				});
			},
			// 开关机设置
			switchSet() {
				uni.navigateTo({
					url: '/pages/my/switch/switchSet'
				});
			},
			BasicsSet() {
				uni.navigateTo({
					url: '/pages/my/basics/BasicsSet'
				});
			},
			administrators() {
				uni.navigateTo({
					url: '/pages/my/administrators/administrators'
				});
			},
			//联系我们
			contact() {
				uni.navigateTo({
					url: '/pages/my/contact/contact'
				});
			},
			use() {
				uni.navigateTo({
					url: 'use/use'
				})
			},
			message(){
				uni.navigateTo({
					url:'/pages/my/message/message'
				})
			},
			service() {
				uni.navigateTo({
					url: '/pages/my/service/service'
				})
			},
			jump() {
				uni.navigateTo({
					url: '../login/binding/binding'
				})
			}
		}
	}
</script>

<style>
	.top-data {
		position: relative;
		height: 500rpx;
	}

	.top-data>.bg {
		position: absolute;
		width: 750rpx;
		height: 350rpx;
	}

	.top-data>.baby {
		position: absolute;
		bottom: 10%;
		width: 200rpx;
		height: 200rpx;
		left: 5%;
		border-radius: 50%;
	}

	.fill {
		position: absolute;
		right: 5%;
		bottom: 9%;
	}

	.fill>image {
		width: 50rpx;
		height: 50rpx;
		margin-right: 10rpx;
		border-radius: 50%;
	}

	/* 信息内容 */
	.section {
		padding: 30rpx;
	}

	.set {
		position: relative;
		height: 120rpx;
		line-height: 60rpx;
	}

	.set>image {
		position: absolute;
		top: 0%;
		left: 3%;
		width: 60rpx;
		height: 60rpx;
	}

	.set>text {
		position: absolute;
		left: 15%;
		font-size: 32rpx;
	}
</style>
